<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>center-block不定宽relative居中</title>
    <style>
        .warp {
            float: left;
            position: relative;
            left: 50%;
        }

        .warp ul {
            position: relative;
            left: -50%;
        }
    </style>
</head>
<body>
<div class="warp">
    <ul>
        <li>这是第一行</li>
        <li>这是第二行</li>
        <li>这是第三行</li>
        <li>这是第四行</li>
    </ul>
</div>
</body>
</html>